package com.joezhou.factory.abstractfactory;

interface CarFactory {
    /**
     * 获取发动机
     *
     * @return 发动机实例
     */
    Engine getEngine();

    /**
     * 获取轮胎
     *
     * @return 轮胎实例
     */
    Tires getTires();
}

class GoodCarFactory implements CarFactory {

    @Override
    public Engine getEngine() {
        return new GoodEngine();
    }

    @Override
    public Tires getTires() {
        return new GoodTires();
    }
}

class BadCarFactory implements CarFactory {

    @Override
    public Engine getEngine() {
        return new BadEngine();
    }

    @Override
    public Tires getTires() {
        return new BadTires();
    }
}